home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / INCLUDES / I3DSHUTI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  35.0 KB  |  694 lines

  1. /* $Id: I3DShUti.H 1.71 1997/06/29 00:05:38 ERIC-G-PC Exp $ */
  2. /*****************************************************************************\
  3. *                                                                             *
  4. * I3DShUti.h                                                                                *
  5. *   IShRasterBuffer definition                                                *
  6. *   IShRasterOffscreen definition                                             *
  7. *   IShLineArt definition                                                     *
  8. *   IShUtilities definition                                                   *
  9. *                                                                             *
  10. *           Copyright (c) 1995-1196, Ray Dream, Inc. All rights reserved.     *
  11. *                                                                             *
  12. \*****************************************************************************/
  13.  
  14. #ifndef __I3DSHUTI__
  15. #define __I3DSHUTI__
  16.  
  17. #ifndef __3DCOTYPE__
  18. #include "3DCoType.h"
  19. #endif
  20.  
  21. #ifndef __ISHSMP__
  22. #include "IShSMP.h"
  23. #endif
  24.  
  25. /****** Globally Unique Ids **************************************************/
  26.  
  27. DEFINE_GUID(IID_IIEnumChunk, 0x36E7B260L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  28. DEFINE_GUID(IID_IShRasterBuffer, 0x38ACE200L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  29. DEFINE_GUID(IID_IShRasterBufferPixelIterator, 0xa0daf130, 0x90e7, 0x11d0, 0xac, 0x10, 0x0, 0x60, 0x97, 0xb, 0xc5, 0x21);
  30. DEFINE_GUID(IID_IShRasterOffscreen, 0x3B30CDC0L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  31. DEFINE_GUID(IID_IShLineArt, 0x3DF1C280L, 0x3A05, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  32. DEFINE_GUID(IID_IShUtilities, 0x987FDA40L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  33. DEFINE_GUID(IID_IShFileStream, 0x5C9601A8L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  34. DEFINE_GUID(IID_IShGraphicDevice, 0x5C9601A9L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  35. DEFINE_GUID(IID_IShMenuManager, 0x5C9601AAL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  36. DEFINE_GUID(IID_IShActionManager, 0x5C9601ABL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  37. DEFINE_GUID(IID_IShAction, 0x5C9601ACL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  38. DEFINE_GUID(IID_IShMouseAction, 0x5C9601ADL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  39. DEFINE_GUID(IID_IShTweener, 0x5C9601AEL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  40. DEFINE_GUID(IID_IInvertibleTweener, 0x5C9601AFL, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  41. DEFINE_GUID(IID_IShViewManager, 0x4926f780, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc);
  42.  
  43. // Classes always available with Ray Dream Designer:
  44. DEFINE_GUID(CLSID_StandardRasterBuffer, 0x93A75022L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  45. DEFINE_GUID(CLSID_StandardRasterOffscreen, 0x93A75020L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  46. DEFINE_GUID(CLSID_StandardRasterMap, 0x93A75018L, 0x3A0D, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  47. DEFINE_GUID(CLSID_StandardRasterSingleChunkOffscreen, 0x48e3d400, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc);    // Offscreen with a single chunk (takes more RAM but is faster)
  48. DEFINE_GUID(CLSID_StandardFileStream, 0x5C9601A9L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  49. DEFINE_GUID(CLSID_StandardTokenStream, 0x28CAEEC0L, 0xA798, 0x11D0, 0x94, 0xE4, 0x00, 0x00, 0xC0, 0xE4, 0x45, 0x87);
  50. DEFINE_GUID(CLSID_StandardFacetMeshAccumulator, 0x14440e60, 0xc57e, 0x11d0, 0x94, 0xe5, 0x0, 0x0, 0xc0, 0xe4, 0x45, 0x87);
  51. DEFINE_GUID(CLSID_StandardFacetMeshIterator, 0x14440e61, 0xc57e, 0x11d0, 0x94, 0xe5, 0x0, 0x0, 0xc0, 0xe4, 0x45, 0x87);
  52.  
  53.  
  54. typedef void* BufferChunk;
  55. struct IShGraphicDevice;
  56. struct I3DShScene;
  57. DECLARE_INTERFACE(IShContext);
  58. DECLARE_INTERFACE(IShView);
  59. DECLARE_INTERFACE(IShControl);
  60. DECLARE_INTERFACE(IShPopup);
  61. struct ISh3DFileStream;
  62. struct IExternalView;
  63.  
  64. /*****************************************************************************\
  65. *  IEnumChunk                                                                 *
  66. *                                                                             *
  67. *    Chunk enumerator                                                         *
  68. *                                                                             *
  69. \*****************************************************************************/
  70.  
  71. #undef  INTERFACE
  72. #define INTERFACE   IEnumChunk
  73.  
  74. DECLARE_INTERFACE_(IEnumChunk, IUnknown) {
  75.     // IUnknown methods
  76.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  77.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  78.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  79.     
  80.     // I3DEnumPatch methods
  81.   STDMETHOD(Next) (THIS_ ULONG celt, BufferChunk** rgelt, ULONG* pceltFetched) PURE;
  82.   STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  83.   STDMETHOD(Reset) (THIS) PURE;
  84.   STDMETHOD(Clone) (THIS_ IEnumChunk** ppenm) PURE;
  85.     };
  86.  
  87. /*****************************************************************************\
  88. *  IShRasterBufferPixelIterator                                               *
  89. *                                                                             *
  90. *    IShRasterBufferPixelIterator alows multiple routines to simultaneously   *
  91. *    use tha data of the associated IShRasterBuffer                           *
  92. *                                                                             *
  93. \*****************************************************************************/
  94.  
  95. #undef  INTERFACE
  96. #define INTERFACE   IShRasterBufferPixelIterator
  97.  
  98. DECLARE_INTERFACE_(IShRasterBufferPixelIterator, IUnknown) {
  99.     // IUnknown methods
  100.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  101.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  102.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  103.  
  104.     // IShRasterBufferPixelIterator methods
  105.     STDMETHOD(SetPosition) (THIS_ short h, short v) PURE;
  106.     STDMETHOD(GoRight) (THIS) PURE;
  107.     STDMETHOD(GoLeft) (THIS) PURE;
  108.     STDMETHOD(GoDown) (THIS) PURE;
  109.     STDMETHOD(GoUp) (THIS) PURE;
  110.     STDMETHOD(Put) (THIS_ void* buffer) PURE;
  111.     STDMETHOD(Get) (THIS_ void* buffer) PURE;
  112.     STDMETHOD_(unsigned long,Get32) (THIS) PURE;
  113.     STDMETHOD(Put32) (THIS_ long value) PURE;
  114.     STDMETHOD(GBufferPut8) (THIS_ char value, short channel) PURE;
  115.     STDMETHOD_(char, GBufferGet8) (THIS_ short channel) PURE;
  116.     };
  117.  
  118. /*****************************************************************************\
  119. *  IShRasterBuffer                                                            *
  120. *                                                                             *
  121. *    IShRasterBuffer is a spooled buffer of chunks that are loaded and        *
  122. *    unload off the disk automaticaly.                                        *
  123. *                                                                             *
  124. \*****************************************************************************/
  125.  
  126. #undef  INTERFACE
  127. #define INTERFACE   IShRasterBuffer
  128.  
  129. DECLARE_INTERFACE_(IShRasterBuffer, IUnknown) {
  130.     // IUnknown methods
  131.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  132.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  133.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  134.  
  135.     // IShRasterBuffer methods
  136.     STDMETHOD(Init) (THIS_ ULONG sizeH, ULONG sizeV, ULONG depth, ULONG planesCount, ULONG background) PURE;
  137.     STDMETHOD(GetParameters) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* depth, ULONG* planesCount, ULONG* background) PURE;
  138.     STDMETHOD(GetChunkInfo) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* rowBytes, ULONG* depth) PURE;
  139.     STDMETHOD_(IEnumChunk*, EnumChunks) (THIS_ RECT3D* area) PURE;
  140.     STDMETHOD(LockChunk) (THIS_ BufferChunk* chunk) PURE;
  141.     STDMETHOD(UnlockChunk) (THIS_ BufferChunk* chunk) PURE;
  142.     STDMETHOD_(void*, GetChunkData) (THIS_ BufferChunk* chunk) PURE;
  143.     STDMETHOD(GetChunkRect) (THIS_ BufferChunk* chunk, RECT3D* rect) PURE;
  144.  
  145.     STDMETHOD_(short, GetDepth) (THIS) PURE;
  146.     STDMETHOD(SetBackground) (THIS_ void* buffer) PURE;
  147.     STDMETHOD(Erase) (THIS) PURE;
  148.  
  149.     STDMETHOD_(IShRasterBufferPixelIterator*, CreatePixelIterator) (THIS) PURE;
  150.  
  151.     STDMETHOD(SetPosition) (THIS_ short h, short v) PURE;
  152.     STDMETHOD(GoRight) (THIS) PURE;
  153.     STDMETHOD(GoLeft) (THIS) PURE;
  154.     STDMETHOD(GoDown) (THIS) PURE;
  155.     STDMETHOD(GoUp) (THIS) PURE;
  156.     STDMETHOD(Put) (THIS_ void* buffer) PURE;
  157.     STDMETHOD(Get) (THIS_ void* buffer) PURE;
  158.     STDMETHOD_(unsigned long,Get32) (THIS) PURE;
  159.     STDMETHOD(Put32) (THIS_ long value) PURE;
  160.     };
  161.  
  162.  
  163. /*****************************************************************************\
  164. *  IShRasterOffscreen                                                         *
  165. *                                                                             *
  166. *    IShRasterOffscreen implements a raster offscreen bitmap. It is           *
  167. *    automaticaly spooled to the disk if necessary.                           *
  168. *                                                                             *
  169. \*****************************************************************************/
  170.  
  171. #undef  INTERFACE
  172. #define INTERFACE   IShRasterOffscreen
  173.  
  174. DECLARE_INTERFACE_(IShRasterOffscreen, IUnknown) {
  175.     // IUnknown methods
  176.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  177.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  178.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  179.  
  180.     // IShRasterBuffer methods
  181.     STDMETHOD(Init) (THIS_ ULONG sizeH, ULONG sizeV, ULONG depth, ULONG planesCount, ULONG background) PURE;
  182.     STDMETHOD(GetParameters) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* depth, ULONG* planesCount, ULONG* background) PURE;
  183.     STDMETHOD(GetChunkInfo) (THIS_ ULONG* sizeH, ULONG* sizeV, ULONG* rowBytes, ULONG* depth) PURE;
  184.     STDMETHOD_(IEnumChunk*, EnumChunks) (THIS_ RECT3D* area) PURE;
  185.     STDMETHOD(LockChunk) (THIS_ BufferChunk* chunk) PURE;
  186.     STDMETHOD(UnlockChunk) (THIS_ BufferChunk* chunk) PURE;
  187.     STDMETHOD_(void*, GetChunkData) (THIS_ BufferChunk* chunk) PURE;
  188.     STDMETHOD(GetChunkRect) (THIS_ BufferChunk* chunk, RECT3D* rect) PURE;
  189.  
  190.     // IShRasterOffscreen methods
  191.     //-- Init
  192.     STDMETHOD(InitOffscreen) (THIS_ short sizeH, short sizeV, short depth) PURE;
  193.     //-- Queries
  194.     STDMETHOD_(short, GetDepth) (THIS) PURE;
  195.     //-- Drawing
  196.     STDMETHOD(BitBlits) (THIS_ IShGraphicDevice* destGD, RECT3D* source, RECT3D* dest) PURE;
  197.     STDMETHOD(SetBackground) (THIS_ void* buffer) PURE;
  198.     STDMETHOD(Erase) (THIS) PURE;
  199.     STDMETHOD(SetPosition) (THIS_ short h, short v) PURE;
  200.     STDMETHOD(GoRight) (THIS) PURE;
  201.     STDMETHOD(GoLeft) (THIS) PURE;
  202.     STDMETHOD(GoDown) (THIS) PURE;
  203.     STDMETHOD(GoUp) (THIS) PURE;
  204.     STDMETHOD(Put) (THIS_ void* buffer) PURE;
  205.     STDMETHOD(Get) (THIS_ void* buffer) PURE;
  206.     STDMETHOD(Save) (THIS_ char* fileName, long id) PURE;
  207.     STDMETHOD(Load) (THIS_ char* fileName, Boolean storeExternally) PURE;
  208.     STDMETHOD_(unsigned long,Get32) (THIS) PURE;
  209.     STDMETHOD(Put32) (THIS_ long value) PURE;
  210.     STDMETHOD(SetColorTable) (THIS_ unsigned long* colors, short size) PURE;
  211.     STDMETHOD(GetColorTable) (THIS_ unsigned long* colors, short &size) PURE;
  212.     };
  213.  
  214. /*****************************************************************************\
  215. *  IShLineArt                                                                 *
  216. *                                                                             *
  217. *    IShLineArt is the equivalent of IShRasterOffscreen in the vector-based   *
  218. *    world: it allows you to draw resolution-independent curves.              *
  219. *    To be used with vector-based renderers.                                  *
  220. *                                                                             *
  221. *        Pseudo "grammar" for drawing:
  222. *        IMAGE =
  223. *            GROUP
  224. *        
  225. *        GROUP = 
  226. *            BeginGroup
  227. *            GROUP | COMPOUND | PATH    | POINT                1 or more times
  228. *            EndGroup
  229. *        
  230. *        COMPOUND = 
  231. *            BeginCompound
  232. *            GROUP | COMPOUND | PATH    | POINT                1 or more times
  233. *            EndCompound
  234. *        
  235. *        PATH =
  236. *            BeginPath
  237. *            LineTo | BezierTo                            1 or more times
  238. *            EndPath
  239. *
  240. *        POINT = DrawVertex | DrawHandle | DrawControl
  241. *                                                                             *
  242. \*****************************************************************************/
  243.  
  244. #undef  INTERFACE
  245. #define INTERFACE   IShLineArt
  246.  
  247. DECLARE_INTERFACE_(IShLineArt, IUnknown) {
  248.     // IUnknown methods
  249.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  250.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  251.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  252.  
  253.     // IShLineArt methods
  254.     STDMETHOD(BeginGroup) (THIS) PURE;
  255.     STDMETHOD(EndGroup) (THIS) PURE;
  256.     STDMETHOD(BeginCompound) (THIS) PURE;                    // Use compounds to make holes
  257.     STDMETHOD(EndCompound) (THIS) PURE;
  258.     STDMETHOD(BeginPath) (THIS_ VECTOR2D* firstPoint) PURE;
  259.     STDMETHOD(LineTo) (THIS_ VECTOR2D* secondPoint) PURE;
  260.     STDMETHOD(BezierTo) (THIS_ VECTOR2D* secondPoint, VECTOR2D* thirdPoint, VECTOR2D* fourthPoint) PURE;
  261.     STDMETHOD(EndPath) (THIS) PURE;
  262.     STDMETHOD(DrawVertex) (THIS_ VECTOR2D* point) PURE;
  263.     STDMETHOD(DrawHandle) (THIS_ VECTOR2D* point) PURE;
  264.     STDMETHOD(DrawControl) (THIS_ VECTOR2D* point) PURE;
  265.     };
  266.  
  267. /*****************************************************************************\
  268. *  IShKeyFrame                                                                *
  269. *                                                                             *
  270. *    Keyframe data                                                            *
  271. *                                                                             *
  272. \*****************************************************************************/
  273.  
  274. #undef  INTERFACE
  275. #define INTERFACE   IShKeyFrame
  276.  
  277. struct Riostream;
  278.  
  279. DECLARE_INTERFACE_(IShKeyFrame, IUnknown) {
  280.     // IUnknown methods
  281.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  282.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  283.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  284.  
  285.     // IShKeyFrame methods
  286.     STDMETHOD(GetParam)(void *param,long type,BOOLEAN &changed) const PURE; 
  287.     STDMETHOD(SetParam)(const void *param,long type) PURE;  
  288.     STDMETHOD_(long,GetType)() const PURE;
  289.     STDMETHOD_(IShKeyFrame *,Clone)() const PURE;
  290.     STDMETHOD(Read)(Riostream& stream) PURE; 
  291.     STDMETHOD(Write)(Riostream& stream) const PURE; 
  292.     STDMETHOD(Copy)(const IShKeyFrame &from) PURE;
  293.     STDMETHOD(LinearInterpolate)(const NUM3D &lamda,const IShKeyFrame &kf1,const IShKeyFrame &kf2) PURE;
  294.     };
  295.  
  296. /*****************************************************************************\
  297. *  IShTweener                                                             *
  298. *                                                                             *
  299. *    Tweener data                                                            *
  300. *                                                                             *
  301. \*****************************************************************************/
  302.  
  303. struct IShTweener;
  304. struct IShKeyFrame;
  305.  
  306. struct XTweenerChainLink {
  307.   IShKeyFrame *fKeyFrame;
  308.   XTweenerChainLink *fPrev;
  309.   XTweenerChainLink *fNext;
  310.     long fTime; 
  311.   IShTweener *fTweener;
  312.     };
  313.     
  314. class LRect;
  315.  
  316. #undef  INTERFACE
  317. #define INTERFACE   IShTweener
  318.  
  319. DECLARE_INTERFACE_(IShTweener, IUnknown) {
  320.     // IUnknown methods
  321.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  322.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  323.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  324.  
  325.     // IShTweener methods
  326.   STDMETHOD_(int,IsEqual)(THIS_ const IShTweener *other) const PURE;
  327.   STDMETHOD_(IShTweener*,Clone)(THIS) const PURE;
  328.   STDMETHOD(DoTween)(THIS_ IShKeyFrame *res,long time,XTweenerChainLink *alink) const PURE;
  329.   STDMETHOD(Draw)(THIS_ IShGraphicDevice* aGD,const LRect* area,const LRect *where) const PURE;
  330.   STDMETHOD_(IShTweener*,Edit)(THIS_ XTweenerChainLink* chainLink) const PURE;
  331.     };
  332.  
  333. #undef  INTERFACE
  334. #define INTERFACE   IInvertibleTweener
  335.  
  336. DECLARE_INTERFACE_(IInvertibleTweener, IUnknown) {
  337.   STDMETHOD(Inverse)() PURE;
  338.     };
  339.  
  340. /*****************************************************************************\
  341. *  IShUtilities                                                               *
  342. *                                                                             *
  343. *    Misc. OS utilities provided by the shell.                                *
  344. *                                                                             *
  345. \*****************************************************************************/
  346.  
  347. #undef  INTERFACE
  348. #define INTERFACE   IShUtilities
  349.  
  350. // GetUIColor() constants:
  351. enum {kShMain3DLook = 1, kShHilite3DLook = 2, kShShadow3DLook = 3, kShDark3DLook = 4,
  352.             kShLightColor = 10,                // Light source color
  353.             kShCameraColor = 11,            // Camera color
  354.             kShSelectionColor = 12,        // Selection & Paint Shapes color
  355.             kShGridColor = 13,                // Grid color
  356.             kShActiveGridColor = 14,    // Active Grid (Drawing Plane) color
  357.             kShOutlineColor = 15,            // Grid outline color
  358.             kShProdFrameColor = 16,        // Production Frame color
  359.             kShBackgrndColor = 17,        // Perspective background color
  360.             kShKeyFrameColor = 18,        // Key Frame color
  361.             kShWireframeColor = 19,        // Wireframe color
  362.             kShMotionPathColor = 20,    // Motion Path color
  363.             kShBBoxColor = 21,                // Bounding Box color
  364.             kShProjectionColor = 22,    // Projection Color
  365.             kShColorModes = 23                // Special: Red=Motion Path color mode, Green=BBox color mode, Blue=Projection color mode
  366.             };
  367.  
  368. class XTimeBased;
  369.  
  370. DECLARE_INTERFACE_(IShUtilities, IUnknown) {
  371.     // IUnknown methods
  372.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  373.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  374.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  375.  
  376.     // IShUtilities methods
  377.     STDMETHOD(YieldProcesses) (THIS_ ULONG ticks) PURE;
  378.     STDMETHOD_(ULONG, TickCount) (THIS) PURE;
  379.     STDMETHOD_(ULONG, Random) (THIS) PURE;
  380.     STDMETHOD(RandomSeed) (THIS_ ULONG newSeed) PURE;
  381.     STDMETHOD(GetSerialNumber) (THIS_ char* serialNumber) PURE;
  382.     //-- Progression bar
  383.     STDMETHOD(ProgressStart) (THIS_ char* prompt, ULONG maxValue) PURE;
  384.     STDMETHOD(ProgressIncrement) (THIS_ ULONG increment) PURE;
  385.     STDMETHOD(ProgressNewValue) (THIS_ ULONG newValue) PURE;
  386.     STDMETHOD(ProgressDone) (THIS) PURE;
  387.     //-- Failure Handling
  388.      STDMETHOD(Failure) (THIS_ short error, long message) PURE;
  389.      STDMETHOD_(void*, GetGTopHandler) (THIS) PURE;
  390.      STDMETHOD_(void*, GetSetJmpAddress) (THIS) PURE;
  391.     //-- Memory Management
  392.      STDMETHOD_(void*, Malloc) (THIS_ unsigned long  size) PURE;
  393.      STDMETHOD_(void*, Calloc) (THIS_ unsigned long nmemb, unsigned long size) PURE;
  394.      STDMETHOD_(void*, Realloc) (THIS_ void* ptr, unsigned long  size) PURE;
  395.      STDMETHOD(Free) (THIS_ void* ptr) PURE;
  396.     //-- Instanciation                
  397.     STDMETHOD(CoCreateInstance) (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter,
  398.                     DWORD dwClsContext, REFIID riid, LPVOID* ppv) PURE;    
  399.     //-- Get COM helper (API level 6)
  400.      STDMETHOD_(void*, GetCOMMap) (THIS_ void *map) PURE;
  401.     //-- Misc. Utilities (API level 6)
  402.     STDMETHOD(GetShellVersion) (THIS_ ULONG* major, ULONG* minor, char* stage, ULONG* stageCount) PURE;
  403.     STDMETHOD_(ULONG, GetAPINumber) (THIS) PURE;
  404.     STDMETHOD(GetIndString) (THIS_ char* str, short strID, short itemNo) PURE;
  405.     STDMETHOD_(BOOLEAN, CheckRegistration) (THIS_ ULONG familyID, ULONG classID, char* productKey, char* productName) PURE;
  406.     STDMETHOD(GetRegistrationName) (THIS_ char* name) PURE;
  407.     STDMETHOD(GetRegistrationOrganization) (THIS_ char* name) PURE;
  408.     //--KeyFrame generation
  409.     STDMETHOD_(IShKeyFrame *,CreateKeyFrame)(long itsType) PURE;
  410.     STDMETHOD_(IShKeyFrame *,ReadKeyFrame)(ISh3DFileStream *stream) PURE;
  411.     STDMETHOD(WriteKeyFrame)(const IShKeyFrame *,ISh3DFileStream *stream) PURE;
  412.     //--Gestalt
  413.     STDMETHOD(Gestalt)(THIS_ void *data,ULONG id) PURE;
  414.     //--Tweener
  415.     STDMETHOD_(IShTweener*,CreateTweener)(long itsType) PURE;
  416.     //--Misc.
  417.     STDMETHOD_(short, DoAlert)(short alertID,                                                                // ID of the ALRT resource
  418.                                                             char* arg0, char* arg1, char* arg2) PURE;        // Strings to be subsituted to '^0', '^1' and '^2'
  419.     STDMETHOD(SetupResource) (THIS_ long* oldMap) PURE;            // Obsolete. do not use.
  420.     STDMETHOD(RestoreResource) (THIS_ long* oldMap) PURE;        // Obsolete. do not use.
  421.     //Import Reports
  422.     STDMETHOD(ResetImportReport) (THIS_ ) PURE;
  423.     STDMETHOD(AddImportProblem) (THIS_ short msgIndex, char* substitutionString, Boolean allowMultipleEntries) PURE;
  424.     STDMETHOD(ShowImportReport) (THIS_ short dialogID,short strListID) PURE;
  425.  
  426.     STDMETHOD(GetUIColor) (THIS_ short uicolor, RGBCOLOR3D* color) PURE;
  427.     STDMETHOD(WriteComponent) (THIS_ const IShTweener* aTweener,ISh3DFileStream* stream) PURE;
  428.     STDMETHOD_(IShTweener*, ReadComponent) (THIS_ ISh3DFileStream* stream) PURE;
  429.     //-- Misc. (API level 9)
  430.     // Opens a modal dialog based on a View resource and a PMap resource. 
  431.     // IMPORTANT: The top view must be a TWindow with a Class Name of 'TStdPMAPWindow'.
  432.     // The value returned is the ID of the item that dismissed the dialog.
  433.     STDMETHOD_(long, DoDialog)(short viewAndPMapID,    // ID of the View and PMap resources
  434.                                                             void* dataBuffer,            // Data buffer used to communicate with the dialog. Works like I3DExDataExchanger: the PMap resource describes the format of the Data Buffer
  435.                                                             void (*onMessageCallBack) (long messageID, long sourceID, PLATFORMEVENT* event, IShView* topWindow, void* privData), // This call-back will be called everytime an event occur, so your code can react. Can be NULL.
  436.                                                             void* privData) PURE;    // Callback's private data
  437.     // Instanciation of external modules (See I3DExModule)
  438.     STDMETHOD(EditInNewWindow) (THIS_ long module, void* elem, I3DShScene* scene, void** window) PURE;
  439.     STDMETHOD(OpenImage) (THIS_ char* filename, long* format) PURE;
  440.     STDMETHOD(SaveImage) (THIS_ char* filename, long* format) PURE;
  441.     STDMETHOD(GetResource) (THIS_ long family, long classID, long resType, void** data) PURE;
  442.     STDMETHOD(SetupResources)(THIS_ long family, long classID, void** oldResources) PURE;
  443.     STDMETHOD(RestoreResources)(THIS_ void* oldResources) PURE;
  444.     };
  445.  
  446. /*****************************************************************************\
  447. *  IShFileStream                                                              *
  448. *                                                                             *
  449. *    Simple stream interface to provide basic file access services.           *
  450. *                                                                             *
  451. \*****************************************************************************/
  452.  
  453. // mode constants:
  454. #define kShStreamIn 1
  455. #define kShStreamOut 2
  456. // Seek direction constants:
  457. #define kShStreamBegin 0
  458. #define kShStreamCurrent 1
  459. #define kShStreamEnd 2
  460.  
  461. #undef  INTERFACE
  462. #define INTERFACE   IShFileStream
  463.  
  464. DECLARE_INTERFACE_(IShFileStream, IUnknown) {
  465.     // IUnknown methods
  466.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  467.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  468.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  469.     
  470.     // IShFileStream methods
  471.     STDMETHOD(InitFileStream) (THIS_ char* fileName, ULONG mode) PURE;
  472.     //-- Seek
  473.     STDMETHOD_(ULONG, Tell) (THIS) PURE;
  474.     STDMETHOD(Seek) (THIS_ ULONG offset, short direction) PURE;
  475.     //-- Bynary io
  476.     STDMETHOD(Read) (THIS_ char* s, ULONG n) PURE;
  477.     STDMETHOD(Write) (THIS_ char* s, ULONG n) PURE;
  478.     STDMETHOD(Append) (THIS_ ULONG n) PURE;
  479.     //-- Text io
  480.     STDMETHOD(Get) (THIS_ char* c) PURE;
  481.     STDMETHOD(GetString) (THIS_ char* str, ULONG count, char delim) PURE;
  482.     STDMETHOD(GetLine) (THIS_ char* str, ULONG count) PURE;
  483.     STDMETHOD(GetLong) (THIS_ long* num) PURE;
  484.     STDMETHOD(GetDouble) (THIS_ Double* num) PURE;
  485.     STDMETHOD(Put) (THIS_ char c) PURE;
  486.     STDMETHOD(PutString) (THIS_ char* str) PURE;
  487.     STDMETHOD(PutLine) (THIS_ char* str) PURE;
  488.     STDMETHOD(PutEOL) (THIS) PURE;
  489.     STDMETHOD(PutLong) (THIS_ long num) PURE;
  490.     STDMETHOD(PutDouble) (THIS_ Double num) PURE;
  491.     STDMETHOD(PutBack) (THIS_ char c) PURE;
  492.     //-- Error
  493.     STDMETHOD_(BOOLEAN, Good) (THIS) PURE;
  494.     STDMETHOD_(BOOLEAN, Fail) (THIS) PURE;
  495.     STDMETHOD_(BOOLEAN, Eof) (THIS) PURE;
  496.     //-- Misc.
  497.     STDMETHOD(SetMacOSInfo) (THIS_ ULONG creator, ULONG type) PURE;
  498.      STDMETHOD_(ULONG, GetFileSize) (THIS) PURE;
  499.     };
  500.  
  501. /*****************************************************************************\
  502. *  IShGraphicDevice                                                           *
  503. *                                                                             *
  504. *    Cross platform graphic device to draw on screen                          *
  505. *                                                                             *
  506. \*****************************************************************************/
  507.  
  508. // Pen Type constants:
  509. #define kShGDSolid 0
  510. #define kShGDDash 1
  511. #define kShGDDot 2
  512. // Pen Mode constants:
  513. #define kShGDXor 3
  514. #define kShGDCopy 4
  515. #define kShGDBic 5
  516. // Text Justification constants:
  517. enum {kShJustLeft=0, kShJustCenter=1, kShJustRight=2, kShMiddleCut=4, kShEndCut=8};
  518. // Text Mode constants:
  519. enum {kShTMNone=0, kShTMEraseFirst=1, kShTMDoNotWrap=2, kShTMCenterVert=4, kShTMTranslateMetaChar=8};
  520.  
  521. #undef  INTERFACE
  522. #define INTERFACE   IShGraphicDevice
  523.  
  524. DECLARE_INTERFACE_(IShGraphicDevice, IUnknown) {
  525.     // IUnknown methods
  526.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  527.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  528.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  529.  
  530.     // IShGraphicDevice methods
  531.     STDMETHOD(MoveTo)(THIS_ long hh,long vv) PURE;
  532.     STDMETHOD(LineTo)(THIS_ long hh,long vv) PURE;
  533.     STDMETHOD(SetPen)(THIS_ short aPenMode,short aPenType,short size,unsigned short rr,unsigned short gg,unsigned short bb) PURE;
  534.     STDMETHOD(ResetPen)(THIS) PURE;
  535.     STDMETHOD(DrawLine)(THIS_ long h1, long v1, long h2, long v2) PURE;
  536.     STDMETHOD(EraseRect)(THIS_ const LRECT3D& theRect) PURE;
  537.     STDMETHOD(InvertRect)(THIS_ const LRECT3D& theRect) PURE;
  538.     STDMETHOD(FrameRect)(THIS_ const LRECT3D& theRect) PURE;
  539.     STDMETHOD(FillRect)(THIS_ const LRECT3D& theRect,unsigned short rr,unsigned short gg,unsigned short bb) PURE;
  540.     STDMETHOD(DrawString)(THIS_ const LRECT3D& theRect, const char* astring, short just, short mode) PURE;
  541.     STDMETHOD(DrawOffscreen)(THIS_ const IShRasterOffscreen *aOffscrn, const RECT3D &srcRect, const LRECT3D &dstRect) PURE;
  542.     STDMETHOD(PlotIcon)(THIS_ long hh,long vv,short dh,short dv,short index) PURE;
  543.     STDMETHOD_(long, StringWidth) (THIS_ const char* string) PURE;
  544.     STDMETHOD(FrameOval)(THIS_ const LRECT3D& theRect) PURE;
  545.     STDMETHOD(FillOval)(THIS_ const LRECT3D& theRect,unsigned short rr,unsigned short gg,unsigned short bb) PURE;
  546.     STDMETHOD(Draw32BitMap)(THIS_ const LPOINT3D &dst,long *pixels,long sizeX,long sizeY,long rowbytes) PURE;
  547.     STDMETHOD(GetActualSystemPtr)(THIS_ void*& data) PURE;    // Returns the platform's specific data
  548.                                                                                                     // If you do cross-platform development, you should NOT use this.
  549.                                                                                                     // MacOS:  'data' should be a CGrafPtr
  550.                                                                                                     // WinTel: 'data' should be a HDC
  551.     };
  552.  
  553. // Preset clipboard types
  554. #define kShTreeElementClipboard IDTYPE('T','R','E','E')
  555. #define kShObjectClipboard IDTYPE('I','N','S','T')
  556.  
  557. DECLARE_INTERFACE_(IShMenuManager, IUnknown) {
  558.     // IUnknown methods
  559.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  560.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  561.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  562.  
  563.     // IShMenuManager
  564.     STDMETHOD(EnableCheckMenu) (THIS_ long anAction, Boolean canDo, Boolean checkIt) PURE;
  565.     STDMETHOD(EnableMenu) (THIS_ long anAction, Boolean canDo) PURE;
  566.     STDMETHOD(DeleteMenuItem) (THIS_ short menu, short item) PURE;
  567.     STDMETHOD(AddMenuItem) (THIS_ short menu, char* commandName, short after, long action) PURE;
  568.     STDMETHOD(AddSubMenuItem) (THIS_ short menu, char* commandName, short submenu, short after) PURE;
  569.     STDMETHOD(ClipboardGetData) (THIS_ long itsType, void** data) PURE; // See preset types above
  570.     STDMETHOD(ClipboardSetData) (THIS_ long itsType,void *itsData,void deleteProc(void*)) PURE;
  571.     STDMETHOD(EnableCheckToolIcon) (THIS_ short tool, Boolean enabled, Boolean checked) PURE;
  572.     };
  573.  
  574. DECLARE_INTERFACE_(IShAction, IUnknown) {
  575.     // IUnknown methods
  576.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  577.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  578.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  579.     // IShAction methods
  580.     STDMETHOD(Do)(THIS) PURE;
  581.     STDMETHOD(Undo)(THIS) PURE;
  582.     STDMETHOD(Redo)(THIS) PURE;
  583.     STDMETHOD_(BOOLEAN, WillCauseChange)(THIS) PURE;
  584.     STDMETHOD_(BOOLEAN, CanUndo)(THIS) PURE;
  585.     STDMETHOD_(IShView*, GetViewToRedraw)(THIS) PURE;            // Gives the opportunity to the IShAction to tell 
  586.                                                                                                                 // the Shell that the returned view should be redrawn 
  587.                                                                                                                 // after Do/Undo/Redo. Return NULL if nothing should occur.
  588.     STDMETHOD(GetName)(THIS_ char* name) PURE;
  589.     };
  590.  
  591. // Tracking Stages for IShMouseAction::Track
  592. #define    kShBeginTracking 0
  593. #define    kShContinueTracking 1
  594. #define    kShFinishTracking 2
  595.  
  596.  
  597. DECLARE_INTERFACE_(IShMouseAction, IUnknown) {
  598.     // IUnknown methods
  599.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  600.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  601.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  602.     // IShMouseAction methods
  603.     STDMETHOD(Do)(THIS) PURE;
  604.     STDMETHOD(Undo)(THIS) PURE;
  605.     STDMETHOD(Redo)(THIS) PURE;
  606.     STDMETHOD_(BOOLEAN, WillCauseChange)(THIS) PURE;
  607.     STDMETHOD_(BOOLEAN, CanUndo)(THIS) PURE;
  608.     STDMETHOD(GetName)(THIS_ char* name) PURE;
  609.     STDMETHOD(Track)(THIS_ IShGraphicDevice* gd, short stage,const LPOINT3D& first,const LPOINT3D &prev,const LPOINT3D &cur,BOOLEAN moved) PURE;  // Return E_ABORT if the tracking should stop and the Action been discarded
  610.     STDMETHOD(Feedback)(THIS_ IShGraphicDevice* gd, short stage,const LPOINT3D& first,const LPOINT3D &prev,const LPOINT3D &cur,BOOLEAN moved,Boolean show) PURE;
  611.     STDMETHOD_(IShView*, GetViewToRedraw)(THIS) PURE;            // Gives the opportunity to the IShMouseAction to tell 
  612.                                                                                                                 // the Shell that the returned view should be redrawn 
  613.                                                                                                                 // after Do/Undo/Redo. Return NULL if nothing should occur.
  614.     STDMETHOD(Constrain)(THIS_ IShGraphicDevice* gd, short stage,const LPOINT3D& first,const LPOINT3D &prev,LPOINT3D &cur,BOOLEAN moved) PURE; 
  615.     };
  616.  
  617. DECLARE_INTERFACE_(IShActionManager, IUnknown) {
  618.     // IUnknown methods
  619.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  620.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  621.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  622.     // IShActionManager methods
  623.     STDMETHOD(PostAction) (THIS_ IShAction* action,long actionNbr,IShContext *context) PURE;
  624.     STDMETHOD(PostMouseAction) (THIS_ IShMouseAction* action,long actionNbr,IShContext *context, IShView *view,const LPOINT3D &mouse) PURE;
  625.     STDMETHOD_(BOOLEAN, IsOptionDown) (THIS) PURE;
  626.     STDMETHOD_(BOOLEAN, IsShiftDown) (THIS) PURE;
  627.     STDMETHOD_(BOOLEAN, IsCommandDown) (THIS) PURE;
  628.     };
  629.  
  630. // The View Manager is a set of callbacks that help you manipulate views in a sophisticated manner.
  631. // The calls using a IShControl* parameter are more restricted: they should be used with views
  632. // of type TButton, TCheckBox, TControl, TEditText, TNumberText, TFixedNumberText, T3DUnitNumberText,
  633. // TPopup, TRadio, TSlider, and TStaticText in AdLib. If you know you are dealing with one of these, then
  634. // cast your IShView* pointer into IShControl* and call the proc. If the view was not of a compatible
  635. // type, then an error code will be returned.
  636. //
  637. // The View Manager is especially usefull when using the callback procedure of the IShUtilities::DoDialog() proc:
  638. // often, one needs to enable or disable items in a dialog, or change text or values. Using the 'topWindow'
  639. // parameter of the callback, call gViewManager->FindSubView(topWindow, IDTYPE(....)) to get a pointer on the dialog item
  640. // you are interested in. Then use this pointer to set or get data with the dialog item using the View Manager again.
  641. //
  642. // The View Manager can of course be used in any situation when the Shell gives you a IShView pointer to play with.
  643. // Just remember that a IShView pointer is a private pointer owned by the Shell (it is NOT a IUnknown object), and
  644. // that you cannot do much more with it than passing it back to the Shell when needed (like when using the View Manager
  645. // for example).
  646.  
  647. DECLARE_INTERFACE_(IShViewManager, IUnknown) {
  648.     // IUnknown methods
  649.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  650.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  651.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  652.     // IShViewManager methods
  653.     STDMETHOD_(IShView*, FindSubView) (THIS_ IShView* view, long theID) PURE;
  654.     STDMETHOD_(IShView*, GetSuperView) (THIS_ IShView* view) PURE;
  655.     STDMETHOD(SetBounds) (THIS_ IShView* view, LRECT3D* newBounds, BOOLEAN forceRedraw) PURE;
  656.     STDMETHOD(GetBounds) (THIS_ IShView* view, LRECT3D* bounds) PURE;
  657.     STDMETHOD(Enable) (THIS_ IShView* view, BOOLEAN enable, BOOLEAN forceRedraw) PURE;
  658.     STDMETHOD_(BOOLEAN, IsEnabled) (THIS_ IShView* view) PURE;
  659.     STDMETHOD(Show) (THIS_ IShView* view, BOOLEAN show, BOOLEAN forceRedraw) PURE;
  660.     STDMETHOD_(BOOLEAN, IsShown) (THIS_ IShView* view) PURE;
  661.     STDMETHOD(Dim) (THIS_ IShView* view, BOOLEAN dim, BOOLEAN forceRedraw) PURE;
  662.     STDMETHOD_(BOOLEAN, IsDimmed) (THIS_ IShView* view) PURE;
  663.     STDMETHOD(ForceRedraw) (THIS_ IShView* view) PURE;    // Post an update event for this view (view will be redrawn later)
  664.     STDMETHOD(RedrawNow) (THIS_ IShView* view) PURE;        // Draw the view immediately
  665.     STDMETHOD(InvalidateRect) (THIS_ IShView* view, LRECT3D* rect) PURE;
  666.     STDMETHOD(ValidateRect) (THIS_ IShView* view, LRECT3D* rect) PURE;
  667.     STDMETHOD(ExposeRect) (THIS_ IShView* view, LRECT3D* rect, LPOINT3D* minToSee, BOOLEAN forceRedraw) PURE;    // Scroll 'rect' into view (provided the view is in a scroller)
  668.     STDMETHOD(GetVisibleLocalBounds) (THIS_ IShView* view, LRECT3D* rect) PURE;        // Returns the part of the view visible withing the super-view's frame.
  669.     STDMETHOD_(IShGraphicDevice*, GetGraphicDevice) (THIS_ IShView* view) PURE;        // You must release the graphic device after use
  670.     //IShControl methods
  671.     STDMETHOD(Flash) (THIS_ IShControl* control) PURE;
  672.     STDMETHOD(SetHilite) (THIS_ IShControl* control, BOOLEAN hilite, BOOLEAN forceRedraw) PURE;
  673.     STDMETHOD_(BOOLEAN, IsHilited) (THIS_ IShControl* control) PURE;
  674.     STDMETHOD(SetValues) (THIS_ IShControl* control, long value, long min, long max, BOOLEAN forceRedraw) PURE;
  675.     STDMETHOD(GetValues) (THIS_ IShControl* control, long* value, long* min, long* max) PURE;
  676.     STDMETHOD(SetText) (THIS_ IShControl* control, char* string, BOOLEAN forceRedraw) PURE;
  677.     STDMETHOD(GetText) (THIS_ IShControl* control, char* string) PURE;
  678.     //IShPopup methods
  679.     STDMETHOD(GetCurrentItem) (IShPopup *popup,short &index) PURE;
  680.     STDMETHOD(SetCurrentItem) (IShPopup *popup,short index,BOOLEAN redraw) PURE;
  681.     STDMETHOD(RemoveAllItems) (IShPopup *popup) PURE;
  682.     STDMETHOD(InsertItemLast) (IShPopup *popup,const char *name) PURE;
  683.     STDMETHOD(Rebuild) (IShPopup *popup) PURE;
  684.     //IExternalView methods
  685.     STDMETHOD(GetExternalView) (IShView *view,IExternalView *&extView) PURE;
  686.     // Misc methods
  687.     STDMETHOD(GetActualSystemWindowPtr) (IShView *view,void *&awindow) PURE;    // Returns the platform's specific data. (a HWND on Wintel, a WindowPtr on a Mac, etc.)
  688.                                                                                                     // If you do cross-platform development, you should NOT use this.
  689.                                                                                                     // MacOS:  'awindow' should be a WindowPtr
  690.                                                                                                     // WinTel: 'awindow' should be a HWND
  691.     };
  692.  
  693. #endif
  694.